package ar.edu.utn.frgp.EjemploHibernate.action.clientes;

import java.util.ArrayList;
import java.util.List;

import ar.edu.utn.frgp.EjemploHibernate.model.Cliente;
import ar.edu.utn.frgp.EjemploHibernate.service.RecursoService;

import com.opensymphony.xwork2.ActionSupport;

public class ListarClienteAction extends ActionSupport {

	private RecursoService service;
	
	private List<Cliente> clientes = new ArrayList<Cliente>();

	private static final long serialVersionUID = 1L;
	
	@Override
	public String execute() throws Exception {
		try {
			clientes = service.getClientes();
			return SUCCESS;
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return ERROR;
		}
	}
	
	
	

	public List<Cliente> getClientes() {
		return clientes;
	}

	public void setClientes(List<Cliente> clientes) {
		this.clientes = clientes;
	}

	public RecursoService getService() {
		return service;
	}

	public void setService(RecursoService service) {
		this.service = service;
	}
}
